package com.geyue.controller;

import com.geyue.common.toolbox.result.Res;
import com.geyue.common.util.StrUtils;
import com.geyue.core.model.Comment;
import com.geyue.core.model.Student;
import com.geyue.core.service.CommentService;
import com.geyue.core.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by Lyon on 2017/4/20.
 */
@RestController
@RequestMapping("/api/comment")
public class CommentController {

    @Autowired
    private CommentService commentService;



    @RequestMapping(value = "/all",method = RequestMethod.GET)
    public Object all(Integer id){
        return commentService.all(id);
    }

    @RequestMapping(value = "/page",method = RequestMethod.GET)
    @ResponseBody
    public Res list(Integer pageSize, Integer pageNum){

        return Res.success("",commentService.getPage(pageNum,pageSize,new Comment()));
    }



}
